package com.chance.cc.crawler.prod.command.trigger.domain.vm.autohome;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.vm.autohome.praiseZd.AutoHomeCarSeriesPraiseCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.vm.autohome.realtime.*;
import com.chance.cc.crawler.prod.command.job.domain.vm.autohome.trace.AutoHomeCarSeriesVideoCommentCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author bx
 * @date 2020/12/7 0007 11:15
 */
public class AutoHomeCarSeriesCommonScheduleTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {//运行工作爬虫
//        publishAutoHomeCarSeriesPraiseRealtimeScheduleTriggerInfo(AutoHomeCarSeriesPraiseCrawlerScheduleJob.publishAutoHomeCarSeriesPraiseCrawlerScheduleJobInfo());//车系口碑
//        publishAutoHomeSeriesArticleRealtimeScheduleTriggerInfo(AutoHomeCarSeriesArticleCrawlerScheduleJob.publishAutoHomeCarSeriesArticleCrawlerScheduleJobInfo());//车系文章
//        publishAutoHomeSeriesArticleCommentRealtimeScheduleTriggerInfo(AutoHomeCarSeriesArticleCommentCrawlerScheduleJob.publishAutoHomeCarSeriesArticleCommentCrawlerScheduleJobInfo());//车系文章评论
//        publishAutoHomeCarSeriesAndConfigRealtimeScheduleTriggerInfo(AutoHomeCarSeriesAndConfigCrawlerScheduleJob.publishAutoHomeCarSeriesAndConfigCrawlerScheduleJobInfo());//车系车型和配置
        publishAutoHomeCarSeriesDistributorRealtimeScheduleTriggerInfo(AutoHomeCarSeriesDistributorCrawlerScheduleJob.publishAutoHomeCarSeriesDistributorCrawlerScheduleJobInfo());//车系经销商
        publishAutoHomeCarSeriesVideoRealtimeScheduleTriggerInfo(AutoHomeCarSeriesVideoCrawlerScheduleJob.publishAutoHomeCarSeriesVideoCrawlerScheduleJobInfo());//车系视频
        publishAutoHomeCarSeriesVideoCommentRealtimeScheduleTriggerInfo(AutoHomeCarSeriesVideoCommentCrawlerScheduleJob.publishAutoHomeCarSeriesVideoCommentCrawlerScheduleJobInfo());//车系视频评论
//            publishAutoHomeCarSeriesForumRealtimeScheduleTriggerInfo(AutoHomeCarSeriesForumCrawlerScheduleJob.publishAutoHomeCarSeriesForumCrawlerScheduleJobInfo());//车系论坛链接
    }

    //车系口碑
    public static void publishAutoHomeCarSeriesPraiseRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                AutoHomeCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 1 * * 1", "汽车之家车系页口碑每周一1点定时采集");//采集信息
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }

    //车系文章
    public static void publishAutoHomeSeriesArticleRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                AutoHomeCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 1 * * ?", "汽车之家车系页文章每天1点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }

    //车系文章评论
    public static void publishAutoHomeSeriesArticleCommentRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                AutoHomeCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 5 * * ?", "汽车之家车系页文章评论每天1点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }
    //车系车型和配置
    public static void publishAutoHomeCarSeriesAndConfigRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                AutoHomeCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 1 10 * ?", "汽车之家车系页车型和配置每月10号1点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }
    //经销商
    public static void publishAutoHomeCarSeriesDistributorRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                AutoHomeCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 1 * * ?", "汽车之家车系页经销商每天1点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }

    //车系视频
    public static void publishAutoHomeCarSeriesVideoRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                AutoHomeCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 1 * * ?", "汽车之家车系页口碑每天1点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }

    //车系视频评论
    public static void publishAutoHomeCarSeriesVideoCommentRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                AutoHomeCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 5 * * ?", "汽车之家车系页视频评论每天5点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }

    //车系论坛链接
    public static void publishAutoHomeCarSeriesForumRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                AutoHomeCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Simple, "0 0 1 17 * ?", "汽车之家车系页视频评论每月1点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }
}
